package com.example.concurrent.CountDownLatch;


import java.util.concurrent.CountDownLatch;

/**
 * Created by Administrator on 2017/2/10 0010.
 */
public class CountDownLatchDemo {
    public static void main(String[] args) {
        try {
            CountDownLatch latch = new CountDownLatch(3);
            Waiter      waiter      = new Waiter(latch);
            Decrementer decrementer = new Decrementer(latch);

            new Thread(waiter)     .start();
            new Thread(decrementer).start();
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
